import 'package:oramemo/generated/json/base/json_convert_content.dart';
import 'package:oramemo/entity/folder_query_entity.dart';

FolderQueryEntity $FolderQueryEntityFromJson(Map<String, dynamic> json) {
  final FolderQueryEntity folderQueryEntity = FolderQueryEntity();
  final String? msg = jsonConvert.convert<String>(json['msg']);
  if (msg != null) {
    folderQueryEntity.msg = msg;
  }
  final int? code = jsonConvert.convert<int>(json['code']);
  if (code != null) {
    folderQueryEntity.code = code;
  }
  final List<FolderQueryData>? data = (json['data'] as List<dynamic>?)
      ?.map(
          (e) => jsonConvert.convert<FolderQueryData>(e) as FolderQueryData)
      .toList();
  if (data != null) {
    folderQueryEntity.data = data;
  }
  return folderQueryEntity;
}

Map<String, dynamic> $FolderQueryEntityToJson(FolderQueryEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['msg'] = entity.msg;
  data['code'] = entity.code;
  data['data'] = entity.data?.map((v) => v.toJson()).toList();
  return data;
}

extension FolderQueryEntityExtension on FolderQueryEntity {
  FolderQueryEntity copyWith({
    String? msg,
    int? code,
    List<FolderQueryData>? data,
  }) {
    return FolderQueryEntity()
      ..msg = msg ?? this.msg
      ..code = code ?? this.code
      ..data = data ?? this.data;
  }
}

FolderQueryData $FolderQueryDataFromJson(Map<String, dynamic> json) {
  final FolderQueryData folderQueryData = FolderQueryData();
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    folderQueryData.createTime = createTime;
  }
  final FolderQueryDataParams? params = jsonConvert.convert<
      FolderQueryDataParams>(json['params']);
  if (params != null) {
    folderQueryData.params = params;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    folderQueryData.id = id;
  }
  final String? folderName = jsonConvert.convert<String>(json['folderName']);
  if (folderName != null) {
    folderQueryData.folderName = folderName;
  }
  final String? userId = jsonConvert.convert<String>(json['userId']);
  if (userId != null) {
    folderQueryData.userId = userId;
  }
  return folderQueryData;
}

Map<String, dynamic> $FolderQueryDataToJson(FolderQueryData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createTime'] = entity.createTime;
  data['params'] = entity.params?.toJson();
  data['id'] = entity.id;
  data['folderName'] = entity.folderName;
  data['userId'] = entity.userId;
  return data;
}

extension FolderQueryDataExtension on FolderQueryData {
  FolderQueryData copyWith({
    String? createTime,
    FolderQueryDataParams? params,
    String? id,
    String? folderName,
    String? userId,
  }) {
    return FolderQueryData()
      ..createTime = createTime ?? this.createTime
      ..params = params ?? this.params
      ..id = id ?? this.id
      ..folderName = folderName ?? this.folderName
      ..userId = userId ?? this.userId;
  }
}

FolderQueryDataParams $FolderQueryDataParamsFromJson(
    Map<String, dynamic> json) {
  final FolderQueryDataParams folderQueryDataParams = FolderQueryDataParams();
  return folderQueryDataParams;
}

Map<String, dynamic> $FolderQueryDataParamsToJson(
    FolderQueryDataParams entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  return data;
}

extension FolderQueryDataParamsExtension on FolderQueryDataParams {
}